package entities;

public class LinkAssociation {
	private Long id;
	private String fromCode;
	private String toCode;
	private String fromType;
	private String toType;
	private String label;
	private int order;
	
	public LinkAssociation() {
		super();
	}
	
	public LinkAssociation(String fromCode, String toCode,
			String fromType, String toType, String label, int order) {
		super();
		this.fromCode = fromCode;
		this.toCode = toCode;
		this.fromType = fromType;
		this.toType = toType;
		this.label = label;
		this.setOrder(order);
	}
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getFromCode() {
		return fromCode;
	}
	public void setFromCode(String fromCode) {
		this.fromCode = fromCode;
	}
	public String getToCode() {
		return toCode;
	}
	public void setToCode(String toCode) {
		this.toCode = toCode;
	}
	public String getFromType() {
		return fromType;
	}
	public void setFromType(String fromType) {
		this.fromType = fromType;
	}
	public String getToType() {
		return toType;
	}
	public void setToType(String toType) {
		this.toType = toType;
	}
	public String getLabel() {
		return label;
	}
	public void setLabel(String label) {
		this.label = label;
	}

	public int getOrder() {
		return order;
	}

	public void setOrder(int order) {
		this.order = order;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((fromCode == null) ? 0 : fromCode.hashCode());
		result = prime * result
				+ ((fromType == null) ? 0 : fromType.hashCode());
		result = prime * result + ((label == null) ? 0 : label.hashCode());
		result = prime * result + order;
		result = prime * result + ((toCode == null) ? 0 : toCode.hashCode());
		result = prime * result + ((toType == null) ? 0 : toType.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		LinkAssociation other = (LinkAssociation) obj;
		if (fromCode == null) {
			if (other.fromCode != null)
				return false;
		} else if (!fromCode.equals(other.fromCode))
			return false;
		if (fromType == null) {
			if (other.fromType != null)
				return false;
		} else if (!fromType.equals(other.fromType))
			return false;
		if (label == null) {
			if (other.label != null)
				return false;
		} else if (!label.equals(other.label))
			return false;
		if (order != other.order)
			return false;
		if (toCode == null) {
			if (other.toCode != null)
				return false;
		} else if (!toCode.equals(other.toCode))
			return false;
		if (toType == null) {
			if (other.toType != null)
				return false;
		} else if (!toType.equals(other.toType))
			return false;
		return true;
	}
	
	
}
